package StudyCode.summary.mycollection;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class SetMapKeysToCommaString {
	public static String setKeysToCommaString(Set s) {
		StringBuffer sb = new StringBuffer();
		Iterator i = s.iterator();
		while (i.hasNext()) {
			Map.Entry o = (Map.Entry) i.next();
			sb.append((String) o.getKey());
			if (i.hasNext()) {
				sb.append(", ");
			}
		}
		return sb.toString();
	}
}
